package com.systemsjr.jrbbf.expense;

import java.util.Date;

import com.systemsjr.jrbbf.account.Account;
import com.systemsjr.jrbbf.common.FinanceEntity;

public class Expense extends FinanceEntity{
	
	private ExpenseType expenseType;
	private double expenseAmount;
	private Account account;
	private String transType;
	private Date date;

	public Expense(ExpenseType expenseType, double expenseAmount, Account account, String transType) {
		super();
		this.expenseType = expenseType;
		this.expenseAmount = expenseAmount;
		this.account = account;
		this.transType = transType;
	}
	
	public Expense(long id, ExpenseType expenseType, double expenseAmount, Account account, String transType) {
		this.expenseType = expenseType;
		this.expenseAmount = expenseAmount;
		this.id = id;
		this.account = account;
		this.transType = transType;
	}
	
	public Expense(ExpenseType expenseType, Account account, String transType){
		this.expenseType = expenseType;
		this.account = account;
		this.transType = transType;
	}
	
	public Expense(){
		
	}
	
	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public String getTransType() {
		return transType;
	}

	public void setTransType(String transType) {
		this.transType = transType;
	}

	public void setExpenseType(ExpenseType expenseType) {
		this.expenseType = expenseType;
	}

	
	public ExpenseType getExpenseType() {
		return expenseType;
	}

	public double getExpenseAmount() {
		return expenseAmount;
	}
	
	public void setExpenseAmount(double expenseAmount) {
		this.expenseAmount = expenseAmount;
	}
			
	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public boolean equals(Object obj) {
		
		Expense exp = (Expense)obj;
		
		if(this.expenseAmount == exp.expenseAmount && this.expenseType == exp.expenseType && this.date.equals(exp.getDate())){
			return true;
		}
		return false;
	}
	
	public String toString(){
		return expenseType.toString();
	}
	
}
